﻿using System.Collections.Generic;
using System.ComponentModel;

namespace EOS.Data
{
    public class EveOverview : INotifyPropertyChanged
    {
        private bool _useSmallColorTags;
        private bool _applyOnlyToShips;
        private bool _hideCorpTicker;
        private bool _overviewBroadcastsToTop;

        private readonly IList<OverviewProfile> _overviewProfiles = new List<OverviewProfile>();
        private readonly IList<OverviewTab> _overviewTabs = new List<OverviewTab>(); // maximum 5, minimum 1
        private readonly IList<OverviewColumn> _columns = new List<OverviewColumn>();

        public bool UseSmallColorTags
        {
            get { return _useSmallColorTags; }
            set
            {
                _useSmallColorTags = value;
                OnPropertyChanged("UseSmallColorTags");
            }
        }

        public bool ApplyOnlyToShips
        {
            get { return _applyOnlyToShips; }
            set
            {
                _applyOnlyToShips = value;
                OnPropertyChanged("ApplyOnlyToShips");
            }
        }

        public bool HideCorpTicker
        {
            get { return _hideCorpTicker; }
            set
            {
                _hideCorpTicker = value;
                OnPropertyChanged("HideCorpTicker");
            }
        }

        public bool OverviewBroadcastsToTop
        {
            get { return _overviewBroadcastsToTop; }
            set
            {
                _overviewBroadcastsToTop = value;
                OnPropertyChanged("OverviewBroadcastsToTop");
            }
        }

        public IList<OverviewProfile> OverviewProfiles
        {
            get { return _overviewProfiles; }
        }

        public IList<OverviewColumn> Columns
        {
            get { return _columns; }
        }

        public IList<OverviewTab> OverviewTabs
        {
            get { return _overviewTabs; }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    public class OverviewProfile : INotifyPropertyChanged
    {
        private readonly IList<OverviewGroup> _overviewGroups;
        private readonly IList<OverviewState> _filteredStates;
        private string _name;

        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                OnPropertyChanged("Name");
            }
        }

        public OverviewProfile(string name, IList<OverviewGroup> overviewGroups, IList<OverviewState> filteredStates)
        {
            _name = name;
            _filteredStates = filteredStates;
            _overviewGroups = overviewGroups;
        }

        public IList<OverviewGroup> OverviewGroups
        {
            get { return _overviewGroups; }
        }

        public IList<OverviewState> FilteredStates
        {
            get { return _filteredStates; }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
